package com.saleoffline.server;

import org.springframework.beans.factory.annotation.Autowired;

import com.saleoffline.server.domain.member.MemberDAO;
import com.saleoffline.server.domain.sale.SaleDAO;

public class BaseController implements ExtentionAware {
	protected User user;
	protected String extention;
	
	@Autowired protected SaleDAO saleDAO;
	@Autowired protected MemberDAO memberDAO;
	
	public void setSaleDAO(SaleDAO saleDAO) {
		this.saleDAO = saleDAO;
	}
	
	public void setMemberDAO(MemberDAO memberDAO) {
		this.memberDAO = memberDAO;
	}
	
	public String getRedirectUrl(String prefix) {
		return prefix + "." + getExtention();
	}

	public String getUserId() {
		return user.getUserId();
	}
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public String getExtention() {
		return extention;
	}

	@Override
	public void setExtention(String extention) {
		this.extention = extention;
	}
}
